//
// Created by 袁绪龙 on 2024/4/29.
//

#ifndef BASIC_OPENGLWIDGET4_H
#define BASIC_OPENGLWIDGET4_H


#include <QOpenGLWidget>
#include <QOpenGLFunctions_3_3_Core>

/// 最基础的绘制三角形 - 给窗体增加事件并触发相应效果
class OpenGLWidget4 : public QOpenGLWidget, QOpenGLFunctions_3_3_Core {
Q_OBJECT
public:
    enum Shape {
        None, Rect, Circle, Triangle
    };

    explicit OpenGLWidget4(QWidget *parent = nullptr);

    ~OpenGLWidget4() override;

    /// 绘制图形
    void drawShape(Shape shape);

    void wrieframeMode(bool mode);

protected:
    void initializeGL() override; ///< QOpenGLWidget的需要实现的函数
    void resizeGL(int w, int h) override; ///< QOpenGLWidget的需要实现的函数
    void paintGL() override; ///< QOpenGLWidget的需要实现的函数

private:
    Shape m_shape;
};


#endif //BASIC_OPENGLWIDGET4_H
